<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
<!-- Required meta tags -->
<meta charset="utf-8" />
<meta name="viewport"
	content="width=device-width, initial-scale=1, shrink-to-fit=no" />


<!-- Meta -->
<meta name="description"
	content="Premium Quality and Responsive UI for Dashboard." />
<meta name="author" content="ThemePixels" />

<link rel="shortcut icon" th:href="@{/admin/picture/favicon.ico}"
	type="image/x-icon" />
<title>旅游管理系统</title>

<!-- vendor css -->
<link th:href="@{/admin/css/font-awesome.css}" rel="stylesheet" />
<link th:href="@{/admin/css/ionicons.css}" rel="stylesheet" />
<link th:href="@{/admin/css/perfect-scrollbar.css}" rel="stylesheet" />
<link th:href="@{/admin/css/github.css}" rel="stylesheet" />
<link th:href="@{/admin/css/jquery.datatables.css}" rel="stylesheet" />
<link th:href="@{/admin/css/select2.min.css}" rel="stylesheet" />

<!-- Starlight CSS -->
<link rel="stylesheet" th:href="@{/admin/css/starlight.css}" />
</head>

<body>

	<!-- ########## START: LEFT PANEL ########## -->
	<div class="sl-logo">
		<a href=""><img th:src="@{/admin/picture/mt_logo_wh.jpg}"
			style="width: 30px; height: 30px;" /> <span style="font-size: 18px">旅游管理系统</span></a>
	</div>
	<div class="sl-sideleft">

		<label class="sidebar-label">导航栏</label>
		<div class="sl-sideleft-menu">
			<a href="#" class="sl-menu-link">
				<div class="sl-menu-item">
					<i class="menu-item-icon icon ion-ios-gear-outline tx-24"></i> <span
						class="menu-item-label">管理</span> <i
						class="menu-item-arrow fa fa-angle-down"></i>
				</div>
				<!-- menu-item -->
			</a>
			<!-- sl-menu-link -->
			<ul class="sl-menu-sub nav flex-column">
				<li class="nav-item"><a th:href="@{/root/findAllAdminByLevel}"
					class="nav-link">酒店列表</a></li>
				<!-- <li class="nav-item"><a th:href="@{/root/addMember}" class="nav-link">添加</a></li>
            <li class="nav-item"><a th:href="@{/root/delMember}" class="nav-link">删除</a></li> -->
			</ul>
			<a href="#" class="sl-menu-link">
				<div class="sl-menu-item">
					<i class="menu-item-icon icon ion-ios-gear-outline tx-24"></i> <span
						class="menu-item-label">酒店管理</span> <i
						class="menu-item-arrow fa fa-angle-down"></i>
				</div>
				<!-- menu-item -->
			</a>
			<!-- sl-menu-link -->
			<ul class="sl-menu-sub nav flex-column">
				<li class="nav-item"><a th:href="@{/root/findAllHotels}"
					class="nav-link">酒店列表</a></li>
				<li class="nav-item"><a th:href="@{/root/addHotel}"
					class="nav-link">酒店添加</a></li>
				<li class="nav-item"><a th:href="@{/root/delHotel}"
					class="nav-link">酒店删除</a></li>
			</ul>
		</div>
		<!-- sl-sideleft-menu -->

	</div>
	<!-- sl-sideleft -->
	<!-- ########## END: LEFT PANEL ########## -->

	<!-- ########## START: HEAD PANEL ########## -->
	<div class="sl-header">
		<div class="sl-header-left">
			<div class="navicon-left hidden-md-down">
				<a id="btnLeftMenu" href=""><i class="icon ion-navicon-round"></i></a>
			</div>
			<div class="navicon-left hidden-lg-up">
				<a id="btnLeftMenuMobile" href=""><i
					class="icon ion-navicon-round"></i></a>
			</div>
		</div>
		<!-- sl-header-left -->
		<div class="sl-header-right">
			<nav class="nav">
				<div class="dropdown">
					<a href="" class="nav-link nav-link-profile" data-toggle="dropdown">
						<span class="logged-name">信息技术系 | 网络工程</span> <img
						th:src="@{/picture/mt_logo_wh.jpg}" class="wd-32 rounded-circle"
						alt="" />
					</a>
					<div class="dropdown-menu dropdown-menu-header wd-200">
						<ul class="list-unstyled user-profile-nav">
							<li><a href=""><i class="icon ion-ios-person-outline"></i>
									Edit Profile</a></li>
							<li><a href=""><i class="icon ion-ios-gear-outline"></i>
									Settings</a></li>
							<li><a href=""><i class="icon ion-ios-download-outline"></i>
									Downloads</a></li>
							<li><a href=""><i class="icon ion-ios-star-outline"></i>
									Favorites</a></li>
							<li><a href=""><i class="icon ion-ios-folder-outline"></i>
									Collections</a></li>
							<li><a th:href="@{/logout}"><i class="icon ion-power"></i>
									Sign Out</a></li>
						</ul>
					</div>
					<!-- dropdown-menu -->
				</div>
				<!-- dropdown -->
			</nav>
			<div class="navicon-right"></div>
			<!-- navicon-right -->
		</div>
		<!-- sl-header-right -->
	</div>
	<!-- sl-header -->
	<!-- ########## END: HEAD PANEL ########## -->

	<!-- ########## START: RIGHT PANEL ########## -->

	<!-- ########## END: RIGHT PANEL ########## -->

	<!-- ########## START: MAIN PANEL ########## -->
	<div class="sl-mainpanel">
		<nav class="breadcrumb sl-breadcrumb">
			<a class="breadcrumb-item" th:href="@{/activity/list}">共享酒店管理系统</a> <a
				class="breadcrumb-item" >酒店管理</a> <span
				class="breadcrumb-item active">酒店列表</span>
		</nav>

		<div class="sl-pagebody">

			<div class="card pd-20 pd-sm-40">
				<h6 class="card-body-title">酒店列表</h6>
				<p class="mg-b-20 mg-sm-b-30">The list of user's information.</p>
				<form th:action="@{/user/list}" method="get"
					onsubmit="return valiForm();">
					<div class="row">
						<div class="col-lg-8 mg-b-10">
							<div class="input-group">
								<!-- <input type="text" class="form-control clo-sm-6 col-md-4" name="keywords"
                                   placeholder="按活动名称搜索..."/>
                            <input type="hidden" id="type"/>
                            <span class="input-group-btn mg-r-20">
                                <button class="btn bd bg-white tx-gray-600" type="submit"><i class="fa fa-search"></i>
                                </button>
                            </span> -->
								<!-- <a class="btn btn-info active btn-block col-lg-3"
									th:href="@{/user/initUser}">添加管理员</a> -->
							</div>
							<!-- input-group -->

						</div>
						<!-- col-4 -->
					</div>
					<!-- row -->
				</form>

				<div class="table-responsive">
					<table class="table table-hover table-bordered mg-b-0">
						<thead class="bg-info">
							<tr>
								<th class="wd-10p" style="text-align: center">酒店编号</th>
								<th class="wd-15p" style="text-align: center">酒店名称</th>
								<th class="wd-10p" style="text-align: center">酒店图片</th>
								<th class="wd-15p" style="text-align: center">酒店地址</th>
								<th class="wd-7p" style="text-align: center">酒店经度</th>
								<th class="wd-7p" style="text-align: center">酒店纬度</th>
								<th class="wd-7p" style="text-align: center">酒店评分</th>
								<th class="wd-7p" style="text-align: center">总销量</th>
								<th class="wd-10p" style="text-align: center">操作</th>
							</tr>
						</thead>
						<tbody>
							<tr th:each="hotel: ${hotels}">
								<td style="text-align: center"><a
									th:text="${hotel.hotelId}"></a></td>
								<td style="text-align: center"><a
									th:text="${hotel.hotelName}"></a></td>
								<td style="text-align: center"><img
									th:src="${hotel.imageUrl}" style="width: 100px; height: 100px"></img></td>
								<td style="text-align: center"><a
									th:text="${hotel.addressDes}"></a></td>
								<td style="text-align: center"><span
									th:text="${hotel.longitude}"></span></td>
								<td style="text-align: center"><span
									th:text="${hotel.latitude}"></span></td>
								<td style="text-align: center"><span
									th:text="${hotel.score}"></span>
								<td style="text-align: center"><span
									th:text="${hotel.sales}"></span></td>
								<td style="text-align: center"><a
									th:href="@{/root/toEditHotel(hotelId=${hotel.hotelId})}">修改</a>|
									<!-- <a th:href='javascript:if(confirm("确定要删除吗？"))window.location.href="@{/root/deleteHotel(hotelId=${hotel.hotelId})}";'
                                       class="click">删除</a> -->
									
									<a th:href="@{/root/deleteHotel(hotelId=${hotel.hotelId})}" onclick="return del()">删除</a>
									<a th:href="@{/root/addMember(hotelId=${hotel.hotelId})}">添加管理员</a></td>
							</tr>
						</tbody>
					</table>
				</div>
				<!-- table-responsive -->

				<!--页码 start-->
				<!-- <div class="ht-80 bd d-flex align-items-center justify-content-center">
                <nav aria-label="Page navigation">
                    <ul class="pagination pagination-basic mg-b-0">

                        <li th:class="${page.pageNo eq 1} ? 'page-item' : 'page-item'">
                            <a class="page-link" aria-label="First" th:if="${page.pageNo eq 1}" href="#">
                                <i class="fa fa-angle-double-left"></i>
                            </a>
                            <a class="page-link" aria-label="First" th:if="${page.pageNo ne 1} and ${page.pageNo &lt; 10}" th:href="@{/user/list(pageNo=1)}">
                                <i class="fa fa-angle-double-left"></i>
                            </a>
                            <a class="page-link" aria-label="First" th:if="${page.pageNo &gt; 11}" th:href="@{/user/list(pageNo=${page.pageNo-10})}">
                                <i class="fa fa-angle-double-left"></i>
                            </a>
                        </li>

                        <li th:class="${page.pageNo eq 1} ? 'page-item' : 'page-item'">
                            <a class="page-link" aria-label="previous" th:if="${page.pageNo eq 1}" href="#">
                                <i class="fa fa-angle-left"></i>
                            </a>
                            <a class="page-link" aria-label="previous" th:unless="${page.pageNo eq 1}" th:href="@{/user/list(pageNo=${page.pageNo-1})}">
                                <i class="fa fa-angle-left"></i>
                            </a>
                        </li>

                        <li th:if="${page.pageTotal eq 0}" class="page-item active"><a class="page-link" href="#">1</a></li>
                        <li th:if="${page.pageTotal ne 0}" th:each="currentPage : ${#numbers.sequence(1, page.pageTotal)}" th:class="${currentPage eq page.pageNo} ? 'page-item active' : 'page-item'">
                            <a th:if="${page.pageNo eq currentPage}" class="page-link" href="#" th:text="${currentPage}">1</a>
                            <a th:if="${page.pageNo ne currentPage} and ${currentPage ne 0}" class="page-link" th:href="@{/user/list(pageNo=${currentPage})}" th:text="${currentPage}">1</a>
                        </li>

                        <li class="page-item">
                            <a class="page-link" aria-label="Next" th:if="${page.pageNo eq page.pageTotal}" href="#">
                                <i class="fa fa-angle-right"></i>
                            </a>
                            <a class="page-link" aria-label="Next" th:if="${page.pageTotal eq 0}" href="#">
                                <i class="fa fa-angle-right"></i>
                            </a>
                            <a class="page-link" aria-label="Next" th:if="${page.pageNo lt page.pageTotal}" th:href="@{/user/list(pageNo=${page.pageNo} + 1)}">
                                <i class="fa fa-angle-right"></i>
                            </a>
                        </li>

                        <li class="page-item">
                            <a class="page-link" aria-label="Last" th:if="${page.pageNo eq page.pageTotal}" href="#">
                                <i class="fa fa-angle-double-right"></i>
                            </a>
                            <a class="page-link" aria-label="Last" th:if="${page.pageNo ne page.pageTotal} and ${pageTotal ge (page.pageNo+10)}" th:href="@{/user/list(pageNo=${page.pageNo} + 10)}">
                                <i class="fa fa-angle-double-right"></i>
                            </a>
                            <a class="page-link" aria-label="Last" th:if="${page.pageNo ne page.pageTotal} and ${pageTotal lt (page.pageNo+10)}" th:href="@{/user/list(pageNo=${page.pageTotal})}">
                                <i class="fa fa-angle-double-right"></i>
                            </a>
                        </li>

                    </ul>
                </nav>
            </div> -->
				<!--页码 end-->
			</div>
			<!-- card -->

		</div>
		<!-- sl-pagebody -->
		<footer class="sl-footer">
			<div class="footer-left">
				<div class="mg-b-2">Copyright &copy; 2018. 中原工学院信息商务学院. All
					Rights Reserved.</div>
			</div>
			<div class="footer-right d-flex align-items-center">Made by
				信息技术系.</div>
		</footer>
	</div>
	<!-- sl-mainpanel -->
	<!-- ########## END: MAIN PANEL ########## -->

	<script th:src="@{/admin/js/jquery.js}"></script>
	<script th:src="@{/admin/js/popper.js}"></script>
	<script th:src="@{/admin/js/bootstrap.js}"></script>
	<script th:src="@{/admin/js/perfect-scrollbar.jquery.js}"></script>
	<script th:src="@{/admin/js/highlight.pack.js}"></script>
	<script th:src="@{/admin/js/jquery.datatables.js}"></script>
	<script th:src="@{/admin/js/datatables.responsive.js}"></script>
	<script th:src="@{/admin/js/select2.min.js}"></script>

	<script th:src="@{/admin/js/starlight.js}"></script>
	<script>
		$(function() {
			'use strict';

			$('#datatable1').DataTable({
				responsive : true,
				bLengthChange : false,
				language : {
					searchPlaceholder : '输入关键字搜索...',
					sSearch : '',
				// lengthMenu: '_MENU_ items/page',
				}
			});

			// Select2
			$('.dataTables_length select').select2({
				minimumResultsForSearch : Infinity
			});

		});
		
	    function del() {  
            if (confirm("您确定要删除吗？")) {  
                return true;  
            } else {  
                return false;  
            }  
    }  
	</script>

</body>
</html>
